package com.tivyso.testing.mock.generator.componentfilter;

import org.apache.commons.lang.Validate;

/**
 * negates the provided filter
 *
 */
public class Not implements IComponentFilter{

	protected final IComponentFilter componentFilter;
	
	/**
	 * @param componentFilter - filter to be negated
	 */
	public Not(IComponentFilter componentFilter){
		Validate.notNull(componentFilter);
		this.componentFilter = componentFilter;
	}
	
	public boolean match(String className) {
		return !componentFilter.match(className);
	}

}
